/**
* @file index.vue
* @author huang
* @date 2023/9/1
* @description Add a brief description of the file here.
* @projectName
* @email newflyhuang@gmail.com
*/
<template>
  <pure-table
    ref="pureTable"
    :list-api="listApi"
    :query-condition="queryCondition"
  >
    <template #header>
      <query-panel
        @query="handleQuery"
        @reset="handleReset"
      >
        <el-form-item>
          <el-input v-model="queryParams.faultRemark" />
        </el-form-item>
        <el-form-item>
          <el-date-picker
            v-model="queryParams.time"
            end-placeholder="结束日期"
            format="yyyy-MM-dd"
            range-separator="至"
            start-placeholder="开始日期"
            type="daterange"
            value-format="yyyy-MM-dd"
          />
        </el-form-item>
      </query-panel>

    </template>
    <el-table-column label="故障描述" />
    <el-table-column label="报修时间" />
    <el-table-column label="报修电话" />
    <el-table-column label="报修科室" />
    <el-table-column label="建单人" />
    <el-table-column label="处理人" />
    <el-table-column label="状态" />

  </pure-table>
</template>

<script>

import QueryPanel from '@/common/components/query/queryPanel.vue';
import OtherWorkOrderApi from './api';

export default {
  components: { QueryPanel, },
  data() {
    return {
      queryParams: {
        faultRemark: '',
        startTime: '',
        endTime: '',
        time: [],
      },
      listApi: OtherWorkOrderApi.getOtherWorkOrderList,
      queryCondition: {},
    };
  },
  methods: {
    // 查询
    handleQuery() {
      this.queryParams.startTime = this.queryParams.time[0];
      this.queryParams.endTime = this.queryParams.time[1];
      this.queryCondition = {
        ...this.queryParams,
      };
    },
    // 重置
    handleReset() {
      this.queryParams = {
        faultRemark: '',
        startTime: '',
        endTime: '',
        time: [],
      };
      this.queryCondition = {};
    },
  },

};
</script>

<style lang='scss'
  scoped
>

</style>
